/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2019年3月20日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package test.lesson3.sort;

import java.util.Arrays;

/**
 * @Type SelectSort
 * @Desc
 * @author 52489
 * @date 2019年3月20日
 * @Version V1.0
 */
public class SelectSort {

    public static void sort(int nums[]) {
        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = i; j < nums.length - 1; j++) {
                int tmp = nums[i];
                if (tmp > nums[j + 1]) {
                    nums[i] = nums[j + 1];
                    nums[j + 1] = tmp;
                    tmp = nums[i];
                }
                System.out.println(Arrays.toString(nums));

            }
        }

        System.out.println(Arrays.toString(nums));
    }

    public static void main(String[] args) {

        int nums[] = { 10, 1, 3, 5, 12, 9, 3, 7, 6, 13, 4 };

        sort(nums);

    }

}
